//
//  ExpandTalkingVillageCell.m
//  社区_
//
//  Created by Hanen 3G 01 on 15/11/12.
//  Copyright © 2015年 Hanen 3G 01. All rights reserved.
//

#import "ExpandTalkingVillageCell.h"
#import "Macro.h"
#import  "MIneDistrictModel.h"
#define lwidth   kScreenWidth / 2

@interface ExpandTalkingVillageCell ()
{
    
        UIView   *_backView;
        CGFloat   space;
        
        UILabel  *_subdistrictNameLabel;
        UILabel  *_responsePersonLabel;
//        UILabel  *_addressLabel;
//        UILabel  *_creatpersonLabel;
    
}
@end

@implementation ExpandTalkingVillageCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ExpandTalkingVillageCellid = @"ExpandTalkingVillageCell";
    ExpandTalkingVillageCell *cell = [tableView dequeueReusableCellWithIdentifier:ExpandTalkingVillageCellid];
    if (cell == nil) {
        cell = [[ExpandTalkingVillageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ExpandTalkingVillageCellid];
        [cell addSubviews];
    }
    
    return cell;
}
- (void)addSubviews
{
   
    space = [UIView getWidth:10.0f];
    
    CGFloat cellH = [ExpandTalkingVillageCell cellHeight];
    _backView =[[UIView alloc] initWithFrame:CGRectMake(1.5 * space, space, kScreenWidth - 3 * space, cellH - space)];
    _backView.backgroundColor = [UIColor whiteColor];
    
    [self.contentView addSubview:_backView];
    
    //小区名图片
    UIImageView  *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(1.5 * space, 1.5 * space, 20.0f, 20.0f)];
    imageView1.image = [UIImage imageNamed:@"Btn_Normal_Xiaoquming"];
    [_backView addSubview:imageView1];
    
    UILabel   *nameLabel = [ViewTool getLabelWith:CGRectMake(imageView1.maxX + 5, imageView1.y, 60.0f, 20.0f) WithTitle:@"小区名:" WithFontSize:15.0f WithTitleColor:BLACKCOLOR WithTextAlignment:NSTextAlignmentLeft];
    [_backView addSubview:nameLabel];
    
    _subdistrictNameLabel = [ViewTool getLabelWith:CGRectMake(nameLabel.maxX, nameLabel.y, _backView.width - nameLabel.maxX, 20.0f) WithTitle:@"" WithFontSize:15.0f WithTitleColor:BLACKCOLOR WithTextAlignment:NSTextAlignmentLeft];
    [_backView addSubview:_subdistrictNameLabel];
    
    UIImageView  *imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(1.5 * space, imageView1.maxY + space, 20.0f, 20.0f)];
    imageView2.image = [UIImage imageNamed:@"Btn_Nor_Lianxiren"];
    [_backView addSubview:imageView2];
    
    UILabel   *nameLabel1 = [ViewTool getLabelWith:CGRectMake(imageView1.maxX + 5, imageView2.y, 60.0f, 20.0f) WithTitle:@"创建人:" WithFontSize:15.0f WithTitleColor:BLACKCOLOR WithTextAlignment:NSTextAlignmentLeft];
    [_backView addSubview:nameLabel1];
    
    _responsePersonLabel = [ViewTool getLabelWith:CGRectMake(nameLabel1.maxX, nameLabel1.y, _backView.width - nameLabel1.maxX, 20.0f) WithTitle:@"" WithFontSize:15.0f WithTitleColor:BLACKCOLOR WithTextAlignment:NSTextAlignmentLeft];
    [_backView addSubview:_responsePersonLabel];
    
    self.numCount = [ViewTool getLabelWith:CGRectMake(200, 50, 60.0f, 15.0f) WithTitle:@"" WithFontSize:13.0f WithTitleColor:SUBTITLECOLOR WithTextAlignment:NSTextAlignmentLeft];
    [_backView addSubview:self.numCount];

}
- (void)setModel:(MIneDistrictModel *)model
{
    _model = model;
    _subdistrictNameLabel.text = model.title;
    _responsePersonLabel.text = model.user_name;//m_user_name负责人
}
//- (void)setArray2:(NSMutableArray *)array2
//{发顺丰
//    //!!!!!!!!!!!!!******
//    _array2 = array2;
//
//    for (int i = 0; i < self.contentView.subviews.count; i ++) {
//        UIView *subView = self.contentView.subviews[i];
//        if ([subView isKindOfClass:[UILabel class]]) {
//            UILabel *label = (UILabel *)subView;
//            label.text = array2[i];
//        }
//    }
//}

//- (void)setCount:(NSInteger)count
//{
//    _count = count;
//}
+ (CGFloat)cellHeight
{
    return [UIView getHeight:80.0f];
}
@end
